<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>商品搜索 | 美多商城</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../C04-Cart/index.html" />
    
    
    <link rel="prev" href="../C03-Goods/GoodsList.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.14"
        data-chapter-title="商品搜索"
        data-filepath="C03-Goods/GoodsSearch.md"
        data-basepath=".."
        data-revision="Sat Aug 11 2018 20:09:13 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        美多商城
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="C01-Prepare/index.html">
            
                
                    <a href="../C01-Prepare/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        项目准备
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="C01-Prepare/BusinessModel.html">
            
                
                    <a href="../C01-Prepare/BusinessModel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        商业模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="C01-Prepare/DevelopmentProcess.html">
            
                
                    <a href="../C01-Prepare/DevelopmentProcess.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        开发流程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="C01-Prepare/ProductAnalysis.html">
            
                
                    <a href="../C01-Prepare/ProductAnalysis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        需求分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="C01-Prepare/ProjectStructure.html">
            
                
                    <a href="../C01-Prepare/ProjectStructure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        项目架构
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="C01-Prepare/StartProject.html">
            
                
                    <a href="../C01-Prepare/StartProject.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        创建工程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="C01-Prepare/Config.html">
            
                
                    <a href="../C01-Prepare/Config.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        配置
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="C02-Users/index.html">
            
                
                    <a href="../C02-Users/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        用户部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="C02-Users/UserModel.html">
            
                
                    <a href="../C02-Users/UserModel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        用户模型类
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="C02-Users/RegisterAnalysis.html">
            
                
                    <a href="../C02-Users/RegisterAnalysis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        注册业务接口分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="C02-Users/ImageCode.html">
            
                
                    <a href="../C02-Users/ImageCode.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        图片验证码
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="C02-Users/SMSCode.html">
            
                
                    <a href="../C02-Users/SMSCode.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        短信验证码
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="C02-Users/CORS.html">
            
                
                    <a href="../C02-Users/CORS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        跨域CORS
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="C02-Users/CelerySendSMSCode.html">
            
                
                    <a href="../C02-Users/CelerySendSMSCode.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        使用Celery发送短信
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="C02-Users/AccountExistingCheck.html">
            
                
                    <a href="../C02-Users/AccountExistingCheck.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        判断帐号是否存在
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="C02-Users/Register.html">
            
                
                    <a href="../C02-Users/Register.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        注册
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="C02-Users/JWT.html">
            
                
                    <a href="../C02-Users/JWT.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        JWT
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="C02-Users/DRF-JWT.html">
            
                
                    <a href="../C02-Users/DRF-JWT.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        Django REST framework JWT
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="C02-Users/Login.html">
            
                
                    <a href="../C02-Users/Login.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        登录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="C02-Users/QQLogin/index.html">
            
                
                    <a href="../C02-Users/QQLogin/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        QQ登录
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.12.1" data-path="C02-Users/QQLogin/Step1.html">
            
                
                    <a href="../C02-Users/QQLogin/Step1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.1.</b>
                        
                        第一步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12.2" data-path="C02-Users/QQLogin/Step2.html">
            
                
                    <a href="../C02-Users/QQLogin/Step2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.2.</b>
                        
                        第二步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12.3" data-path="C02-Users/QQLogin/Step3.html">
            
                
                    <a href="../C02-Users/QQLogin/Step3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.3.</b>
                        
                        第三步
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="C02-Users/UserInfo.html">
            
                
                    <a href="../C02-Users/UserInfo.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        用户中心个人信息
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="C02-Users/Email/index.html">
            
                
                    <a href="../C02-Users/Email/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        邮件与验证
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.14.1" data-path="C02-Users/Email/DjangoEmail.html">
            
                
                    <a href="../C02-Users/Email/DjangoEmail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.1.</b>
                        
                        Django发送邮件的方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14.2" data-path="C02-Users/Email/SendEmail.html">
            
                
                    <a href="../C02-Users/Email/SendEmail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.2.</b>
                        
                        保存邮箱并发送验证邮件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14.3" data-path="C02-Users/Email/VerifyEmail.html">
            
                
                    <a href="../C02-Users/Email/VerifyEmail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.3.</b>
                        
                        验证邮箱链接
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.15" data-path="C02-Users/Address/index.html">
            
                
                    <a href="../C02-Users/Address/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        收货地址
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.15.1" data-path="C02-Users/Address/AreaSelect.html">
            
                
                    <a href="../C02-Users/Address/AreaSelect.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.1.</b>
                        
                        省市区地址查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15.2" data-path="C02-Users/Address/Cache.html">
            
                
                    <a href="../C02-Users/Address/Cache.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.2.</b>
                        
                        使用缓存
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15.3" data-path="C02-Users/Address/UserAddressManagement.html">
            
                
                    <a href="../C02-Users/Address/UserAddressManagement.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.3.</b>
                        
                        用户地址管理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15.4" data-path="C02-Users/Address/UserAddressCode.html">
            
                
                    <a href="../C02-Users/Address/UserAddressCode.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.4.</b>
                        
                        用户地址代码
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="C03-Goods/index.html">
            
                
                    <a href="../C03-Goods/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        商品部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="C03-Goods/DatabaseDesign.html">
            
                
                    <a href="../C03-Goods/DatabaseDesign.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        数据表设计
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="C03-Goods/FastDFS.html">
            
                
                    <a href="../C03-Goods/FastDFS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        FastDFS分布式文件系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="C03-Goods/Docker/index.html">
            
                
                    <a href="../C03-Goods/Docker/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        Docker使用
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.3.1" data-path="C03-Goods/Docker/Introduce.html">
            
                
                    <a href="../C03-Goods/Docker/Introduce.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.1.</b>
                        
                        Docker简介
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.2" data-path="C03-Goods/Docker/InstallAndOperations.html">
            
                
                    <a href="../C03-Goods/Docker/InstallAndOperations.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.2.</b>
                        
                        安装与操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="C03-Goods/FastDFSDocker.html">
            
                
                    <a href="../C03-Goods/FastDFSDocker.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        使用Docker安装FastDFS
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="C03-Goods/FastDFSClientAndDjangoFileSystem.html">
            
                
                    <a href="../C03-Goods/FastDFSClientAndDjangoFileSystem.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        FastDFS客户端与自定义文件存储系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="C03-Goods/CKEditor.html">
            
                
                    <a href="../C03-Goods/CKEditor.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        CKEditor富文本编辑器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="C03-Goods/ImportGoodsData.html">
            
                
                    <a href="../C03-Goods/ImportGoodsData.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        添加测试数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="C03-Goods/FreezeHTML.html">
            
                
                    <a href="../C03-Goods/FreezeHTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        页面静态化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="C03-Goods/DjangoCrontab.html">
            
                
                    <a href="../C03-Goods/DjangoCrontab.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        定时任务
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="C03-Goods/GenerateIndexHTMLScript.html">
            
                
                    <a href="../C03-Goods/GenerateIndexHTMLScript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        静态化首页的手动脚本
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="C03-Goods/GoodsDetail.html">
            
                
                    <a href="../C03-Goods/GoodsDetail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        商品详情页面
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="C03-Goods/UserBrowseHistory.html">
            
                
                    <a href="../C03-Goods/UserBrowseHistory.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.12.</b>
                        
                        用户浏览历史记录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="C03-Goods/GoodsList.html">
            
                
                    <a href="../C03-Goods/GoodsList.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.13.</b>
                        
                        商品列表页
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="3.14" data-path="C03-Goods/GoodsSearch.html">
            
                
                    <a href="../C03-Goods/GoodsSearch.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.14.</b>
                        
                        商品搜索
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="C04-Cart/index.html">
            
                
                    <a href="../C04-Cart/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        购物车部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="C04-Cart/DataStructureDesign.html">
            
                
                    <a href="../C04-Cart/DataStructureDesign.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        购物车数据存储设计
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="C04-Cart/Add.html">
            
                
                    <a href="../C04-Cart/Add.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        购物车增加
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="C04-Cart/Query.html">
            
                
                    <a href="../C04-Cart/Query.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        购物车查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="C04-Cart/Modify.html">
            
                
                    <a href="../C04-Cart/Modify.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        购物车修改
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="C04-Cart/Delete.html">
            
                
                    <a href="../C04-Cart/Delete.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        购物车删除
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="C04-Cart/SelectAll.html">
            
                
                    <a href="../C04-Cart/SelectAll.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        购物车全选
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="C04-Cart/MergeCart.html">
            
                
                    <a href="../C04-Cart/MergeCart.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        登录合并购物车
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="C05-Order/index.html">
            
                
                    <a href="../C05-Order/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        订单部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="C05-Order/OrderDBModel.html">
            
                
                    <a href="../C05-Order/OrderDBModel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        订单数据库设计
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="C05-Order/PlaceOrder.html">
            
                
                    <a href="../C05-Order/PlaceOrder.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        订单结算
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="C05-Order/SaveOrder.html">
            
                
                    <a href="../C05-Order/SaveOrder.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        保存订单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="C05-Order/OrderSuccess.html">
            
                
                    <a href="../C05-Order/OrderSuccess.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        下单成功
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="C06-Pay/index.html">
            
                
                    <a href="../C06-Pay/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        支付宝支付
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="C06-Pay/Alipay.html">
            
                
                    <a href="../C06-Pay/Alipay.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        接入支付宝
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="C06-Pay/Paying.html">
            
                
                    <a href="../C06-Pay/Paying.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        发起支付
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="C06-Pay/PaymentResult.html">
            
                
                    <a href="../C06-Pay/PaymentResult.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        保存支付结果
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="C07-Xadmin.html">
            
                
                    <a href="../C07-Xadmin.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        Xadmin
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="C08-Permission.html">
            
                
                    <a href="../C08-Permission.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        用户权限控制
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >美多商城</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x5546;&#x54C1;&#x641C;&#x7D22;">&#x5546;&#x54C1;&#x641C;&#x7D22;</h1>
<p><img src="../images/&#x641C;&#x7D22;&#x9875;&#x9762;.png" alt="&#x5546;&#x54C1;&#x641C;&#x7D22;"></p>
<h3 id="1--&#x9700;&#x6C42;&#x5206;&#x6790;">1.  &#x9700;&#x6C42;&#x5206;&#x6790;</h3>
<p>&#x5F53;&#x7528;&#x6237;&#x5728;&#x641C;&#x7D22;&#x6846;&#x8F93;&#x5165;&#x5173;&#x952E;&#x5B57;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x8981;&#x4E3A;&#x7528;&#x6237;&#x63D0;&#x4F9B;&#x76F8;&#x5173;&#x7684;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x3002;</p>
<p>&#x8FD9;&#x79CD;&#x9700;&#x6C42;&#x4F9D;&#x8D56;&#x6570;&#x636E;&#x5E93;&#x7684;&#x6A21;&#x7CCA;&#x67E5;&#x8BE2;like&#x5173;&#x952E;&#x5B57;&#x53EF;&#x4EE5;&#x5B9E;&#x73B0;&#xFF0C;&#x4F46;&#x662F;like&#x5173;&#x952E;&#x5B57;&#x7684;&#x6548;&#x7387;&#x6781;&#x4F4E;&#xFF0C;&#x800C;&#x4E14;&#x67E5;&#x8BE2;&#x9700;&#x8981;&#x5728;&#x591A;&#x4E2A;&#x5B57;&#x6BB5;&#x4E2D;&#x8FDB;&#x884C;&#xFF0C;&#x4F7F;&#x7528;like&#x5173;&#x952E;&#x5B57;&#x4E5F;&#x4E0D;&#x65B9;&#x4FBF;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x5F15;&#x5165;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x6765;&#x5B9E;&#x73B0;&#x5168;&#x6587;&#x68C0;&#x7D22;&#x3002;&#x5168;&#x6587;&#x68C0;&#x7D22;&#x5373;&#x5728;&#x6307;&#x5B9A;&#x7684;&#x4EFB;&#x610F;&#x5B57;&#x6BB5;&#x4E2D;&#x8FDB;&#x884C;&#x68C0;&#x7D22;&#x67E5;&#x8BE2;&#x3002;</p>
<h3 id="2--&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x539F;&#x7406;">2.  &#x641C;&#x7D22;&#x5F15;&#x64CE;&#x539F;&#x7406;</h3>
<p>&#x901A;&#x8FC7;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x8FDB;&#x884C;&#x6570;&#x636E;&#x67E5;&#x8BE2;&#x65F6;&#xFF0C;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x5E76;&#x4E0D;&#x662F;&#x76F4;&#x63A5;&#x5728;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x8FDB;&#x884C;&#x67E5;&#x8BE2;&#xFF0C;&#x800C;&#x662F;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x4F1A;&#x5BF9;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x4E00;&#x904D;&#x9884;&#x5904;&#x7406;&#xFF0C;&#x5355;&#x72EC;&#x5EFA;&#x7ACB;&#x8D77;&#x4E00;&#x4EFD;&#x7D22;&#x5F15;&#x7ED3;&#x6784;&#x6570;&#x636E;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5C06;&#x7D22;&#x5F15;&#x7ED3;&#x6784;&#x6570;&#x636E;&#x60F3;&#x8C61;&#x6210;&#x662F;&#x5B57;&#x5178;&#x4E66;&#x7C4D;&#x7684;&#x7D22;&#x5F15;&#x68C0;&#x7D22;&#x9875;&#xFF0C;&#x91CC;&#x9762;&#x5305;&#x542B;&#x4E86;&#x5173;&#x952E;&#x8BCD;&#x4E0E;&#x8BCD;&#x6761;&#x7684;&#x5BF9;&#x5E94;&#x5173;&#x7CFB;&#xFF0C;&#x5E76;&#x8BB0;&#x5F55;&#x8BCD;&#x6761;&#x7684;&#x4F4D;&#x7F6E;&#x3002;</p>
<p><img src="../images/&#x5B57;&#x5178;&#x7D22;&#x5F15;&#x9875;.jpg" alt="&#x5B57;&#x5178;&#x7D22;&#x5F15;&#x9875;"></p>
<p>&#x6211;&#x4EEC;&#x5728;&#x901A;&#x8FC7;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x641C;&#x7D22;&#x65F6;&#xFF0C;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x5C06;&#x5173;&#x952E;&#x5B57;&#x5728;&#x7D22;&#x5F15;&#x6570;&#x636E;&#x4E2D;&#x8FDB;&#x884C;&#x5FEB;&#x901F;&#x5BF9;&#x6BD4;&#x67E5;&#x627E;&#xFF0C;&#x8FDB;&#x800C;&#x627E;&#x5230;&#x6570;&#x636E;&#x7684;&#x771F;&#x5B9E;&#x5B58;&#x50A8;&#x4F4D;&#x7F6E;&#x3002;</p>
<h3 id="3--elasticsearch">3.  Elasticsearch</h3>
<p>&#x5F00;&#x6E90;&#x7684; <a href="https://www.elastic.co/" target="_blank">Elasticsearch </a> &#x662F;&#x76EE;&#x524D;&#x5168;&#x6587;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x7684;&#x9996;&#x9009;&#x3002;</p>
<p>&#x5B83;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x5730;&#x50A8;&#x5B58;&#x3001;&#x641C;&#x7D22;&#x548C;&#x5206;&#x6790;&#x6D77;&#x91CF;&#x6570;&#x636E;&#x3002;&#x7EF4;&#x57FA;&#x767E;&#x79D1;&#x3001;Stack Overflow&#x3001;Github &#x90FD;&#x91C7;&#x7528;&#x5B83;&#x3002;</p>
<p>Elasticsearch &#x7684;&#x5E95;&#x5C42;&#x662F;&#x5F00;&#x6E90;&#x5E93; <a href="https://lucene.apache.org/" target="_blank">Lucene</a>&#x3002;&#x4F46;&#x662F;&#xFF0C;&#x4F60;&#x6CA1;&#x6CD5;&#x76F4;&#x63A5;&#x7528; Lucene&#xFF0C;&#x5FC5;&#x987B;&#x81EA;&#x5DF1;&#x5199;&#x4EE3;&#x7801;&#x53BB;&#x8C03;&#x7528;&#x5B83;&#x7684;&#x63A5;&#x53E3;&#x3002;Elastic &#x662F; Lucene &#x7684;&#x5C01;&#x88C5;&#xFF0C;&#x63D0;&#x4F9B;&#x4E86; REST API &#x7684;&#x64CD;&#x4F5C;&#x63A5;&#x53E3;&#xFF0C;&#x5F00;&#x7BB1;&#x5373;&#x7528;&#x3002;</p>
<p>Elasticsearch &#x662F;&#x7528;Java&#x5B9E;&#x73B0;&#x7684;&#x3002;</p>
<p>&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x5728;&#x5BF9;&#x6570;&#x636E;&#x6784;&#x5EFA;&#x7D22;&#x5F15;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x5206;&#x8BCD;&#x5904;&#x7406;&#x3002;&#x5206;&#x8BCD;&#x662F;&#x6307;&#x5C06;&#x4E00;&#x53E5;&#x8BDD;&#x62C6;&#x89E3;&#x6210;&#x591A;&#x4E2A;&#x5355;&#x5B57;&#x6216;&#x8BCD;&#xFF0C;&#x8FD9;&#x4E9B;&#x5B57;&#x6216;&#x8BCD;&#x4FBF;&#x662F;&#x8FD9;&#x53E5;&#x8BDD;&#x7684;&#x5173;&#x952E;&#x8BCD;&#x3002;&#x5982;</p>
<pre><code class="lang-python">&#x6211;&#x662F;&#x4E2D;&#x56FD;&#x4EBA;&#x3002;
</code></pre>
<p>&apos;&#x6211;&apos;&#x3001;&apos;&#x662F;&apos;&#x3001;&apos;&#x4E2D;&apos;&#x3001;&apos;&#x56FD;&apos;&#x3001;&apos;&#x4EBA;&apos;&#x3001;&apos;&#x4E2D;&#x56FD;&apos;&#x7B49;&#x90FD;&#x53EF;&#x4EE5;&#x662F;&#x8FD9;&#x53E5;&#x8BDD;&#x7684;&#x5173;&#x952E;&#x8BCD;&#x3002;</p>
<p>Elasticsearch &#x4E0D;&#x652F;&#x6301;&#x5BF9;&#x4E2D;&#x6587;&#x8FDB;&#x884C;&#x5206;&#x8BCD;&#x5EFA;&#x7ACB;&#x7D22;&#x5F15;&#xFF0C;&#x9700;&#x8981;&#x914D;&#x5408;&#x6269;&#x5C55;<strong>elasticsearch-analysis-ik</strong>&#x6765;&#x5B9E;&#x73B0;&#x4E2D;&#x6587;&#x5206;&#x8BCD;&#x5904;&#x7406;&#x3002;</p>
<h3 id="4--&#x4F7F;&#x7528;docker&#x5B89;&#x88C5;elasticsearch&#x53CA;&#x5176;&#x6269;&#x5C55;">4.  &#x4F7F;&#x7528;Docker&#x5B89;&#x88C5;Elasticsearch&#x53CA;&#x5176;&#x6269;&#x5C55;</h3>
<p>&#x83B7;&#x53D6;&#x955C;&#x50CF;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x7F51;&#x7EDC;pull</p>
<pre><code class="lang-shell">docker image pull delron/elasticsearch-ik:2.4.6-1.0
</code></pre>
<p>&#x6216;&#x8005;&#x52A0;&#x8F7D;&#x63D0;&#x4F9B;&#x7ED9;&#x5927;&#x5BB6;&#x7684;&#x955C;&#x50CF;&#x6587;&#x4EF6;</p>
<pre><code class="lang-shell">docker load -i elasticsearch-ik-2.4.6_docker.tar
</code></pre>
<p>&#x4FEE;&#x6539;elasticsearch&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6; elasticsearc-2.4.6/config/elasticsearch.yml&#x7B2C;54&#x884C;&#xFF0C;&#x66F4;&#x6539;ip&#x5730;&#x5740;&#x4E3A;&#x672C;&#x673A;ip&#x5730;&#x5740;</p>
<pre><code class="lang-yml">network.host: 10.211.55.5
</code></pre>
<p>&#x521B;&#x5EFA;docker&#x5BB9;&#x5668;&#x8FD0;&#x884C;</p>
<pre><code class="lang-shell">docker run -dti --network=host --name=elasticsearch -v /home/python/elasticsearch-2.4.6/config:/usr/share/elasticsearch/config delron/elasticsearch-ik:2.4.6-1.0
</code></pre>
<h3 id="5-&#x4F7F;&#x7528;haystack&#x5BF9;&#x63A5;elasticsearch">5. &#x4F7F;&#x7528;haystack&#x5BF9;&#x63A5;Elasticsearch</h3>
<p>Haystack&#x4E3A;Django&#x63D0;&#x4F9B;&#x4E86;&#x6A21;&#x5757;&#x5316;&#x7684;&#x641C;&#x7D22;&#x3002;&#x5B83;&#x7684;&#x7279;&#x70B9;&#x662F;&#x7EDF;&#x4E00;&#x7684;&#xFF0C;&#x719F;&#x6089;&#x7684;API&#xFF0C;&#x53EF;&#x4EE5;&#x8BA9;&#x4F60;&#x5728;&#x4E0D;&#x4FEE;&#x6539;&#x4EE3;&#x7801;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x4F7F;&#x7528;&#x4E0D;&#x540C;&#x7684;&#x641C;&#x7D22;&#x540E;&#x7AEF;&#xFF08;&#x6BD4;&#x5982; Solr, Elasticsearch, Whoosh, Xapian &#x7B49;&#x7B49;&#xFF09;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x5728;django&#x4E2D;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4F7F;&#x7528;haystack&#x6765;&#x8C03;&#x7528;Elasticsearch&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x3002; </p>
<p>1&#xFF09;&#x5B89;&#x88C5;</p>
<pre><code class="lang-python">pip install drf-haystack
pip install elasticsearch==<span class="hljs-number">2.4</span><span class="hljs-number">.1</span>
</code></pre>
<p>drf-haystack&#x662F;&#x4E3A;&#x4E86;&#x5728;REST framework&#x4E2D;&#x4F7F;&#x7528;haystack&#x800C;&#x8FDB;&#x884C;&#x7684;&#x5C01;&#x88C5;&#xFF08;&#x5982;&#x679C;&#x5728;Django&#x4E2D;&#x4F7F;&#x7528;haystack&#xFF0C;&#x5219;&#x5B89;&#x88C5;django-haystack&#x5373;&#x53EF;&#xFF09;&#x3002;</p>
<p>2&#xFF09;&#x6CE8;&#x518C;&#x5E94;&#x7528;</p>
<pre><code class="lang-python">INSTALLED_APPS = [
    ...
    <span class="hljs-string">&apos;haystack&apos;</span>,
    ...
]
</code></pre>
<p>3&#xFF09;&#x914D;&#x7F6E;</p>
<p>&#x5728;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x914D;&#x7F6E;haystack&#x4F7F;&#x7528;&#x7684;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x540E;&#x7AEF;</p>
<pre><code class="lang-python"><span class="hljs-comment"># Haystack</span>
HAYSTACK_CONNECTIONS = {
    <span class="hljs-string">&apos;default&apos;</span>: {
        <span class="hljs-string">&apos;ENGINE&apos;</span>: <span class="hljs-string">&apos;haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine&apos;</span>,
        <span class="hljs-string">&apos;URL&apos;</span>: <span class="hljs-string">&apos;http://10.211.55.5:9200/&apos;</span>,  <span class="hljs-comment"># &#x6B64;&#x5904;&#x4E3A;elasticsearch&#x8FD0;&#x884C;&#x7684;&#x670D;&#x52A1;&#x5668;ip&#x5730;&#x5740;&#xFF0C;&#x7AEF;&#x53E3;&#x53F7;&#x56FA;&#x5B9A;&#x4E3A;9200</span>
        <span class="hljs-string">&apos;INDEX_NAME&apos;</span>: <span class="hljs-string">&apos;meiduo&apos;</span>,  <span class="hljs-comment"># &#x6307;&#x5B9A;elasticsearch&#x5EFA;&#x7ACB;&#x7684;&#x7D22;&#x5F15;&#x5E93;&#x7684;&#x540D;&#x79F0;</span>
    },
}

<span class="hljs-comment"># &#x5F53;&#x6DFB;&#x52A0;&#x3001;&#x4FEE;&#x6539;&#x3001;&#x5220;&#x9664;&#x6570;&#x636E;&#x65F6;&#xFF0C;&#x81EA;&#x52A8;&#x751F;&#x6210;&#x7D22;&#x5F15;</span>
HAYSTACK_SIGNAL_PROCESSOR = <span class="hljs-string">&apos;haystack.signals.RealtimeSignalProcessor&apos;</span>
</code></pre>
<p><strong>&#x6CE8;&#x610F;&#xFF1A;</strong></p>
<p><strong>HAYSTACK_SIGNAL_PROCESSOR &#x7684;&#x914D;&#x7F6E;&#x4FDD;&#x8BC1;&#x4E86;&#x5728;Django&#x8FD0;&#x884C;&#x8D77;&#x6765;&#x540E;&#xFF0C;&#x6709;&#x65B0;&#x7684;&#x6570;&#x636E;&#x4EA7;&#x751F;&#x65F6;&#xFF0C;haystack&#x4ECD;&#x7136;&#x53EF;&#x4EE5;&#x8BA9;Elasticsearch&#x5B9E;&#x65F6;&#x751F;&#x6210;&#x65B0;&#x6570;&#x636E;&#x7684;&#x7D22;&#x5F15;</strong></p>
<p>4&#xFF09;&#x521B;&#x5EFA;&#x7D22;&#x5F15;&#x7C7B;</p>
<p>&#x901A;&#x8FC7;&#x521B;&#x5EFA;&#x7D22;&#x5F15;&#x7C7B;&#xFF0C;&#x6765;&#x6307;&#x660E;&#x8BA9;&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x5BF9;&#x54EA;&#x4E9B;&#x5B57;&#x6BB5;&#x5EFA;&#x7ACB;&#x7D22;&#x5F15;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x54EA;&#x4E9B;&#x5B57;&#x6BB5;&#x7684;&#x5173;&#x952E;&#x5B57;&#x6765;&#x68C0;&#x7D22;&#x6570;&#x636E;&#x3002;</p>
<p>&#x5728;goods&#x5E94;&#x7528;&#x4E2D;&#x65B0;&#x5EFA;search_indexes.py&#x6587;&#x4EF6;&#xFF0C;&#x7528;&#x4E8E;&#x5B58;&#x653E;&#x7D22;&#x5F15;&#x7C7B;</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> haystack <span class="hljs-keyword">import</span> indexes

<span class="hljs-keyword">from</span> .models <span class="hljs-keyword">import</span> SKU


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SKUIndex</span><span class="hljs-params">(indexes.SearchIndex, indexes.Indexable)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    SKU&#x7D22;&#x5F15;&#x6570;&#x636E;&#x6A21;&#x578B;&#x7C7B;
    &quot;&quot;&quot;</span>
    text = indexes.CharField(document=<span class="hljs-keyword">True</span>, use_template=<span class="hljs-keyword">True</span>)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_model</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-string">&quot;&quot;&quot;&#x8FD4;&#x56DE;&#x5EFA;&#x7ACB;&#x7D22;&#x5F15;&#x7684;&#x6A21;&#x578B;&#x7C7B;&quot;&quot;&quot;</span>
        <span class="hljs-keyword">return</span> SKU

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">index_queryset</span><span class="hljs-params">(self, using=None)</span>:</span>
        <span class="hljs-string">&quot;&quot;&quot;&#x8FD4;&#x56DE;&#x8981;&#x5EFA;&#x7ACB;&#x7D22;&#x5F15;&#x7684;&#x6570;&#x636E;&#x67E5;&#x8BE2;&#x96C6;&quot;&quot;&quot;</span>
        <span class="hljs-keyword">return</span> self.get_model().objects.filter(is_launched=<span class="hljs-keyword">True</span>)
</code></pre>
<p>&#x5728;SKUIndex&#x5EFA;&#x7ACB;&#x7684;&#x5B57;&#x6BB5;&#xFF0C;&#x90FD;&#x53EF;&#x4EE5;&#x501F;&#x52A9;haystack&#x7531;elasticsearch&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x67E5;&#x8BE2;&#x3002;</p>
<p>&#x5176;&#x4E2D;text&#x5B57;&#x6BB5;&#x6211;&#x4EEC;&#x58F0;&#x660E;&#x4E3A;document=True&#xFF0C;&#x8868;&#x540D;&#x8BE5;&#x5B57;&#x6BB5;&#x662F;&#x4E3B;&#x8981;&#x8FDB;&#x884C;&#x5173;&#x952E;&#x5B57;&#x67E5;&#x8BE2;&#x7684;&#x5B57;&#x6BB5;&#xFF0C; &#x8BE5;&#x5B57;&#x6BB5;&#x7684;&#x7D22;&#x5F15;&#x503C;&#x53EF;&#x4EE5;&#x7531;&#x591A;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#x6A21;&#x578B;&#x7C7B;&#x5B57;&#x6BB5;&#x7EC4;&#x6210;&#xFF0C;&#x5177;&#x4F53;&#x7531;&#x54EA;&#x4E9B;&#x6A21;&#x578B;&#x7C7B;&#x5B57;&#x6BB5;&#x7EC4;&#x6210;&#xFF0C;&#x6211;&#x4EEC;&#x7528;use_template=True&#x8868;&#x793A;&#x540E;&#x7EED;&#x901A;&#x8FC7;&#x6A21;&#x677F;&#x6765;&#x6307;&#x660E;&#x3002;&#x5176;&#x4ED6;&#x5B57;&#x6BB5;&#x90FD;&#x662F;&#x901A;&#x8FC7;model_attr&#x9009;&#x9879;&#x6307;&#x660E;&#x5F15;&#x7528;&#x6570;&#x636E;&#x5E93;&#x6A21;&#x578B;&#x7C7B;&#x7684;&#x7279;&#x5B9A;&#x5B57;&#x6BB5;&#x3002;</p>
<p>&#x5728;REST framework&#x4E2D;&#xFF0C;&#x7D22;&#x5F15;&#x7C7B;&#x7684;&#x5B57;&#x6BB5;&#x4F1A;&#x4F5C;&#x4E3A;&#x67E5;&#x8BE2;&#x7ED3;&#x679C;&#x8FD4;&#x56DE;&#x6570;&#x636E;&#x7684;&#x6765;&#x6E90;&#x3002;</p>
<p>6&#xFF09;&#x5728;templates&#x76EE;&#x5F55;&#x4E2D;&#x521B;&#x5EFA;text&#x5B57;&#x6BB5;&#x4F7F;&#x7528;&#x7684;&#x6A21;&#x677F;&#x6587;&#x4EF6;</p>
<p>&#x5177;&#x4F53;&#x5728;templates/search/indexes/goods/sku_text.txt&#x6587;&#x4EF6;&#x4E2D;&#x5B9A;&#x4E49;</p>
<pre><code class="lang-python">{{ object.name }}
{{ object.caption }}
{{ object.id }}
</code></pre>
<p>&#x6B64;&#x6A21;&#x677F;&#x6307;&#x660E;&#x5F53;&#x5C06;&#x5173;&#x952E;&#x8BCD;&#x901A;&#x8FC7;text&#x53C2;&#x6570;&#x540D;&#x4F20;&#x9012;&#x65F6;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;sku&#x7684;name&#x3001;caption&#x3001;id&#x6765;&#x8FDB;&#x884C;&#x5173;&#x952E;&#x5B57;&#x7D22;&#x5F15;&#x67E5;&#x8BE2;&#x3002;</p>
<p>7&#xFF09;&#x624B;&#x52A8;&#x751F;&#x6210;&#x521D;&#x59CB;&#x7D22;&#x5F15;</p>
<pre><code class="lang-python">python manage.py rebuild_index
</code></pre>
<p>8&#xFF09;&#x521B;&#x5EFA;&#x5E8F;&#x5217;&#x5316;&#x5668;</p>
<p>&#x5728;goods/serializers.py&#x4E2D;&#x521B;&#x5EFA;haystack&#x5E8F;&#x5217;&#x5316;&#x5668;</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> drf_haystack.serializers <span class="hljs-keyword">import</span> HaystackSerializer

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SKUSerializer</span><span class="hljs-params">(serializers.ModelSerializer)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    SKU&#x5E8F;&#x5217;&#x5316;&#x5668;
    &quot;&quot;&quot;</span>
    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        model = SKU
        fields = (<span class="hljs-string">&apos;id&apos;</span>, <span class="hljs-string">&apos;name&apos;</span>, <span class="hljs-string">&apos;price&apos;</span>, <span class="hljs-string">&apos;default_image_url&apos;</span>, <span class="hljs-string">&apos;comments&apos;</span>)

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SKUIndexSerializer</span><span class="hljs-params">(HaystackSerializer)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    SKU&#x7D22;&#x5F15;&#x7ED3;&#x679C;&#x6570;&#x636E;&#x5E8F;&#x5217;&#x5316;&#x5668;
    &quot;&quot;&quot;</span>
    object = SKUSerializer(read_only=<span class="hljs-keyword">True</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        index_classes = [SKUIndex]
        fields = (<span class="hljs-string">&apos;text&apos;</span>, <span class="hljs-string">&apos;object&apos;</span>)
</code></pre>
<h5 id="&#x8BF4;&#x660E;&#xFF1A;">&#x8BF4;&#x660E;&#xFF1A;</h5>
<ol>
<li><p>&#x4E0B;&#x9762;&#x7684;&#x641C;&#x7D22;&#x89C6;&#x56FE;&#x4F7F;&#x7528;SKUIndexSerializer&#x5E8F;&#x5217;&#x5316;&#x5668;&#x7528;&#x6765;&#x68C0;&#x67E5;&#x524D;&#x7AEF;&#x4F20;&#x5165;&#x7684;&#x53C2;&#x6570;text&#xFF0C;&#x5E76;&#x4E14;&#x68C0;&#x7D22;&#x51FA;&#x6570;&#x636E;&#x540E;&#x518D;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x5E8F;&#x5217;&#x5316;&#x5668;&#x8FD4;&#x56DE;&#x7ED9;&#x524D;&#x7AEF;&#xFF1B;</p>
</li>
<li><p>SKUIndexSerializer&#x5E8F;&#x5217;&#x5316;&#x5668;&#x4E2D;&#x7684;object&#x5B57;&#x6BB5;&#x662F;&#x7528;&#x6765;&#x5411;&#x524D;&#x7AEF;&#x8FD4;&#x56DE;&#x6570;&#x636E;&#x65F6;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x5B57;&#x6BB5;&#x3002;</p>
<p>Haystack&#x901A;&#x8FC7;Elasticsearch&#x68C0;&#x7D22;&#x51FA;&#x5339;&#x914D;&#x5173;&#x952E;&#x8BCD;&#x7684;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x540E;&#xFF0C;&#x8FD8;&#x4F1A;&#x5728;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x53D6;&#x51FA;&#x5B8C;&#x6574;&#x7684;&#x6570;&#x636E;&#x5E93;&#x6A21;&#x578B;&#x7C7B;&#x5BF9;&#x8C61;&#xFF0C;&#x653E;&#x5230;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x7684;object&#x5C5E;&#x6027;&#x4E2D;&#xFF0C;&#x5E76;&#x5C06;&#x7ED3;&#x679C;&#x901A;&#x8FC7;SKUIndexSerializer&#x5E8F;&#x5217;&#x5316;&#x5668;&#x8FDB;&#x884C;&#x5E8F;&#x5217;&#x5316;&#x3002;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x58F0;&#x660E;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x7684;object&#x5B57;&#x6BB5;&#x4EE5;SKUSerializer&#x5E8F;&#x5217;&#x5316;&#x7684;&#x5F62;&#x5F0F;&#x8FDB;&#x884C;&#x5904;&#x7406;&#xFF0C;&#x660E;&#x786E;&#x8981;&#x8FD4;&#x56DE;&#x7684;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x4E2D;&#x6BCF;&#x4E2A;&#x6570;&#x636E;&#x5BF9;&#x8C61;&#x5305;&#x542B;&#x54EA;&#x4E9B;&#x5B57;&#x6BB5;&#x3002;</p>
<p>&#x5982;&#xFF0C;&#x901A;&#x8FC7;&#x4E0A;&#x9762;&#x4E24;&#x4E2A;&#x5E8F;&#x5217;&#x5316;&#x5668;&#xFF0C;&#x6700;&#x7EC8;&#x7684;&#x8FD4;&#x56DE;&#x7ED3;&#x679C;&#x5F62;&#x5F0F;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-json">[
    {
        <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+128GB &#x94BB;&#x96D5;&#x84DD; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;\nwifi&#x53CC;&#x5929;&#x7EBF;&#x8BBE;&#x8BA1;&#xFF01;&#x5F95;&#x5361;&#x4EBA;&#x50CF;&#x6444;&#x5F71;&#xFF01;P10&#x5F95;&#x5361;&#x53CC;&#x6444;&#x62CD;&#x7167;&#xFF0C;&#x4F4E;&#x81F3;2988&#x5143;&#xFF01;\n11&quot;</span>,
        <span class="hljs-string">&quot;object&quot;</span>: {
            <span class="hljs-string">&quot;id&quot;</span>: <span class="hljs-number">11</span>,
            <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+128GB &#x94BB;&#x96D5;&#x84DD; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;&quot;</span>,
            <span class="hljs-string">&quot;price&quot;</span>: <span class="hljs-string">&quot;3788.00&quot;</span>,
            <span class="hljs-string">&quot;default_image_url&quot;</span>: <span class="hljs-string">&quot;http://image.meiduo.site:8888/group1/M00/00/02/CtM3BVrRdG6AYdapAAcPaeOqMpA1594598&quot;</span>,
            <span class="hljs-string">&quot;comments&quot;</span>: <span class="hljs-number">2</span>
        }
    },
    {
        <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+128GB &#x73AB;&#x7470;&#x91D1; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;\nwifi&#x53CC;&#x5929;&#x7EBF;&#x8BBE;&#x8BA1;&#xFF01;&#x5F95;&#x5361;&#x4EBA;&#x50CF;&#x6444;&#x5F71;&#xFF01;P10&#x5F95;&#x5361;&#x53CC;&#x6444;&#x62CD;&#x7167;&#xFF0C;&#x4F4E;&#x81F3;2988&#x5143;&#xFF01;\n14&quot;</span>,
        <span class="hljs-string">&quot;object&quot;</span>: {
            <span class="hljs-string">&quot;id&quot;</span>: <span class="hljs-number">14</span>,
            <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+128GB &#x73AB;&#x7470;&#x91D1; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;&quot;</span>,
            <span class="hljs-string">&quot;price&quot;</span>: <span class="hljs-string">&quot;3788.00&quot;</span>,
            <span class="hljs-string">&quot;default_image_url&quot;</span>: <span class="hljs-string">&quot;http://image.meiduo.site:8888/group1/M00/00/02/CtM3BVrRdMSAaDUtAAVslh9vkK04466364&quot;</span>,
            <span class="hljs-string">&quot;comments&quot;</span>: <span class="hljs-number">1</span>
        }
    }
]
</code></pre>
</li>
</ol>
<p>9&#xFF09;&#x521B;&#x5EFA;&#x89C6;&#x56FE;</p>
<p>&#x5728;goods/views.py&#x4E2D;&#x521B;&#x5EFA;&#x89C6;&#x56FE;</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> drf_haystack.viewsets <span class="hljs-keyword">import</span> HaystackViewSet

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SKUSearchViewSet</span><span class="hljs-params">(HaystackViewSet)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    SKU&#x641C;&#x7D22;
    &quot;&quot;&quot;</span>
    index_models = [SKU]

    serializer_class = SKUIndexSerializer
</code></pre>
<h5 id="&#x6CE8;&#x610F;&#xFF1A;">&#x6CE8;&#x610F;&#xFF1A;</h5>
<ul>
<li>&#x8BE5;&#x89C6;&#x56FE;&#x4F1A;&#x8FD4;&#x56DE;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x7684;&#x5217;&#x8868;&#x6570;&#x636E;&#xFF0C;&#x6240;&#x4EE5;&#x5982;&#x679C;&#x53EF;&#x4EE5;&#x4E3A;&#x89C6;&#x56FE;&#x589E;&#x52A0;REST framework&#x7684;&#x5206;&#x9875;&#x529F;&#x80FD;&#x3002;</li>
<li>&#x6211;&#x4EEC;&#x5728;&#x5B9E;&#x73B0;&#x5546;&#x54C1;&#x5217;&#x8868;&#x9875;&#x9762;&#x65F6;&#x5DF2;&#x7ECF;&#x5B9A;&#x4E49;&#x4E86;&#x5168;&#x5C40;&#x7684;&#x5206;&#x9875;&#x914D;&#x7F6E;&#xFF0C;&#x6240;&#x4EE5;&#x6B64;&#x641C;&#x7D22;&#x89C6;&#x56FE;&#x4F1A;&#x4F7F;&#x7528;&#x5168;&#x5C40;&#x7684;&#x5206;&#x9875;&#x914D;&#x7F6E;&#x3002;</li>
</ul>
<p>&#x8FD4;&#x56DE;&#x7684;&#x6570;&#x636E;&#x4E3E;&#x4F8B;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-json">{
    <span class="hljs-string">&quot;count&quot;</span>: <span class="hljs-number">10</span>,
    <span class="hljs-string">&quot;next&quot;</span>: <span class="hljs-string">&quot;http://api.meiduo.site:8000/skus/search/?page=2&amp;text=%E5%8D%8E&quot;</span>,
    <span class="hljs-string">&quot;previous&quot;</span>: <span class="hljs-literal">null</span>,
    <span class="hljs-string">&quot;results&quot;</span>: [
        {
            <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+64GB &#x94BB;&#x96D5;&#x91D1; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;\nwifi&#x53CC;&#x5929;&#x7EBF;&#x8BBE;&#x8BA1;&#xFF01;&#x5F95;&#x5361;&#x4EBA;&#x50CF;&#x6444;&#x5F71;&#xFF01;P10&#x5F95;&#x5361;&#x53CC;&#x6444;&#x62CD;&#x7167;&#xFF0C;&#x4F4E;&#x81F3;2988&#x5143;&#xFF01;\n9&quot;</span>,
            <span class="hljs-string">&quot;id&quot;</span>: <span class="hljs-number">9</span>,
            <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+64GB &#x94BB;&#x96D5;&#x91D1; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;&quot;</span>,
            <span class="hljs-string">&quot;price&quot;</span>: <span class="hljs-string">&quot;3388.00&quot;</span>,
            <span class="hljs-string">&quot;default_image_url&quot;</span>: <span class="hljs-string">&quot;http://10.211.55.5:8888/group1/M00/00/02/CtM3BVrRcUeAHp9pAARfIK95am88523545&quot;</span>,
            <span class="hljs-string">&quot;comments&quot;</span>: <span class="hljs-number">0</span>
        },
        {
            <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+128GB &#x94BB;&#x96D5;&#x91D1; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;\nwifi&#x53CC;&#x5929;&#x7EBF;&#x8BBE;&#x8BA1;&#xFF01;&#x5F95;&#x5361;&#x4EBA;&#x50CF;&#x6444;&#x5F71;&#xFF01;P10&#x5F95;&#x5361;&#x53CC;&#x6444;&#x62CD;&#x7167;&#xFF0C;&#x4F4E;&#x81F3;2988&#x5143;&#xFF01;\n10&quot;</span>,
            <span class="hljs-string">&quot;id&quot;</span>: <span class="hljs-number">10</span>,
            <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;&#x534E;&#x4E3A; HUAWEI P10 Plus 6GB+128GB &#x94BB;&#x96D5;&#x91D1; &#x79FB;&#x52A8;&#x8054;&#x901A;&#x7535;&#x4FE1;4G&#x624B;&#x673A; &#x53CC;&#x5361;&#x53CC;&#x5F85;&quot;</span>,
            <span class="hljs-string">&quot;price&quot;</span>: <span class="hljs-string">&quot;3788.00&quot;</span>,
            <span class="hljs-string">&quot;default_image_url&quot;</span>: <span class="hljs-string">&quot;http://10.211.55.5:8888/group1/M00/00/02/CtM3BVrRchWAMc8rAARfIK95am88158618&quot;</span>,
            <span class="hljs-string">&quot;comments&quot;</span>: <span class="hljs-number">5</span>
        }
    ]
}
</code></pre>
<p>10&#xFF09;&#x5B9A;&#x4E49;&#x8DEF;&#x7531;</p>
<p>&#x901A;&#x8FC7;REST framework&#x7684;router&#x6765;&#x5B9A;&#x4E49;&#x8DEF;&#x7531;</p>
<pre><code class="lang-python">router = DefaultRouter()
router.register(<span class="hljs-string">&apos;skus/search&apos;</span>, views.SKUSearchViewSet, base_name=<span class="hljs-string">&apos;skus_search&apos;</span>)

...

urlpatterns += router.urls
</code></pre>
<p>11&#xFF09;&#x6D4B;&#x8BD5;</p>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;GET&#x65B9;&#x6CD5;&#x8BBF;&#x95EE;&#x5982;&#x4E0B;&#x94FE;&#x63A5;&#x8FDB;&#x884C;&#x6D4B;&#x8BD5;</p>
<pre><code class="lang-http">http://api.meiduo.site:8000/skus/search/?text=wifi
</code></pre>
<h4 id="bug&#x8BF4;&#x660E;&#xFF1A;">bug&#x8BF4;&#x660E;&#xFF1A;</h4>
<p>&#x5982;&#x679C;&#x5728;&#x914D;&#x7F6E;&#x5B8C;haystack&#x5E76;&#x542F;&#x52A8;&#x7A0B;&#x5E8F;&#x540E;&#xFF0C;&#x51FA;&#x73B0;&#x5982;&#x4E0B;&#x5F02;&#x5E38;&#xFF0C;&#x662F;&#x56E0;&#x4E3A;drf-haystack&#x8FD8;&#x6CA1;&#x6709;&#x9002;&#x914D;&#x6700;&#x65B0;&#x7248;&#x672C;&#x7684;REST framework&#x6846;&#x67B6;</p>
<p><img src="../images/get_count&#x5F02;&#x5E38;.png" alt="haystack&#x5F02;&#x5E38;"></p>
<p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4FEE;&#x6539;REST framework&#x6846;&#x67B6;&#x4EE3;&#x7801;&#xFF0C;&#x8865;&#x5145;<code>_get_count</code>&#x51FD;&#x6570;&#x5B9A;&#x4E49;&#x5373;&#x53EF;</p>
<p>&#x6587;&#x4EF6;&#x8DEF;&#x5F84;  &#x865A;&#x62DF;&#x73AF;&#x5883;&#x4E0B;&#x7684; <code>lib/python3.6/site-packages/rest_framework/pagination.py</code></p>
<pre><code class="lang-python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">_get_count</span><span class="hljs-params">(queryset)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    Determine an object count, supporting either querysets or regular lists.
    &quot;&quot;&quot;</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-keyword">return</span> queryset.count()
    <span class="hljs-keyword">except</span> (AttributeError, TypeError):
        <span class="hljs-keyword">return</span> len(queryset)
</code></pre>
<h3 id="6-&#x524D;&#x7AEF;">6. &#x524D;&#x7AEF;</h3>
<p>&#x5728;&#x4EFB;&#x4F55;&#x6709;&#x63D0;&#x4F9B;&#x641C;&#x7D22;&#x6846;&#x7684;&#x9875;&#x9762;&#x4E2D;&#xFF0C;&#x641C;&#x7D22;&#x6846;&#x7684;&#x8868;&#x5355;&#x90FD;&#x7C7B;&#x4F3C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-title">form</span> <span class="hljs-attribute">method</span>=<span class="hljs-value">&quot;get&quot;</span> <span class="hljs-attribute">action</span>=<span class="hljs-value">&quot;/search.html&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;search_con&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;input_text fl&quot;</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">&quot;q&quot;</span> <span class="hljs-attribute">placeholder</span>=<span class="hljs-value">&quot;&#x641C;&#x7D22;&#x5546;&#x54C1;&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;submit&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;input_btn fr&quot;</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">&quot;&quot;</span> <span class="hljs-attribute">value</span>=<span class="hljs-value">&quot;&#x641C;&#x7D22;&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">form</span>&gt;</span>
</code></pre>
<p>&#x5F53;&#x8F93;&#x5165;&#x5173;&#x952E;&#x5B57;&#x5E76;&#x70B9;&#x51FB;&#x641C;&#x83B7;&#x540E;&#xFF0C;&#x4F1A;&#x8FDB;&#x5165;&#x5230;/search.html?q=&#x5173;&#x952E;&#x8BCD;</p>
<p>&#x6784;&#x5EFA;search.html</p>
<pre><code class="lang-html"><span class="hljs-doctype">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">html</span> <span class="hljs-attribute">xmlns</span>=<span class="hljs-value">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span class="hljs-attribute">xml:lang</span>=<span class="hljs-value">&quot;en&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">meta</span> <span class="hljs-attribute">http-equiv</span>=<span class="hljs-value">&quot;Content-Type&quot;</span> <span class="hljs-attribute">content</span>=<span class="hljs-value">&quot;text/html;charset=UTF-8&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">title</span>&gt;</span>&#x7F8E;&#x591A;&#x5546;&#x57CE;-&#x641C;&#x7D22;&#x7ED3;&#x679C;<span class="hljs-tag">&lt;/<span class="hljs-title">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">link</span> <span class="hljs-attribute">rel</span>=<span class="hljs-value">&quot;stylesheet&quot;</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text/css&quot;</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;css/reset.css&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">link</span> <span class="hljs-attribute">rel</span>=<span class="hljs-value">&quot;stylesheet&quot;</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text/css&quot;</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;css/main.css&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text/javascript&quot;</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;js/host.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-title">script</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text/javascript&quot;</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;js/vue-2.5.16.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-title">script</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text/javascript&quot;</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;js/axios-0.18.0.min.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-title">script</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">&quot;app&quot;</span> <span class="hljs-attribute">v-cloak</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;header_con&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;header&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;welcome fl&quot;</span>&gt;</span>&#x6B22;&#x8FCE;&#x6765;&#x5230;&#x7F8E;&#x591A;&#x5546;&#x57CE;!<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;fr&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">v-if</span>=<span class="hljs-value">&quot;username&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;login_btn fl&quot;</span>&gt;</span>
                    &#x6B22;&#x8FCE;&#x60A8;&#xFF1A;<span class="hljs-tag">&lt;<span class="hljs-title">em</span>&gt;</span>[[ username ]]<span class="hljs-tag">&lt;/<span class="hljs-title">em</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> @<span class="hljs-attribute">click</span>=<span class="hljs-value">&quot;logout&quot;</span>&gt;</span>&#x9000;&#x51FA;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">v-else</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;login_btn fl&quot;</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;login.html&quot;</span>&gt;</span>&#x767B;&#x5F55;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;register.html&quot;</span>&gt;</span>&#x6CE8;&#x518C;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;user_link fl&quot;</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;user_center_info.html&quot;</span>&gt;</span>&#x7528;&#x6237;&#x4E2D;&#x5FC3;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;cart.html&quot;</span>&gt;</span>&#x6211;&#x7684;&#x8D2D;&#x7269;&#x8F66;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;user_center_order.html&quot;</span>&gt;</span>&#x6211;&#x7684;&#x8BA2;&#x5355;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>        
    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;search_bar clearfix&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;index.html&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;logo fl&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">img</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;images/logo.png&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;search_wrap fl&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">form</span> <span class="hljs-attribute">method</span>=<span class="hljs-value">&quot;get&quot;</span> <span class="hljs-attribute">action</span>=<span class="hljs-value">&quot;/search.html&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;search_con&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;input_text fl&quot;</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">&quot;q&quot;</span> <span class="hljs-attribute">placeholder</span>=<span class="hljs-value">&quot;&#x641C;&#x7D22;&#x5546;&#x54C1;&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;submit&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;input_btn fr&quot;</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">&quot;&quot;</span> <span class="hljs-attribute">value</span>=<span class="hljs-value">&quot;&#x641C;&#x7D22;&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">form</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">ul</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;search_suggest fl&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7D22;&#x5C3C;&#x5FAE;&#x5355;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4F18;&#x60E0;15&#x5143;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7F8E;&#x5986;&#x4E2A;&#x62A4;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4E70;2&#x514D;1<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">ul</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;guest_cart fr&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;cart_name fl&quot;</span>&gt;</span>&#x6211;&#x7684;&#x8D2D;&#x7269;&#x8F66;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;goods_count fl&quot;</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">&quot;show_count&quot;</span>&gt;</span>15<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

            <span class="hljs-tag">&lt;<span class="hljs-title">ul</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;cart_goods_show&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">img</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;images/goods/goods001.jpg&quot;</span> <span class="hljs-attribute">alt</span>=<span class="hljs-value">&quot;&#x5546;&#x54C1;&#x56FE;&#x7247;&quot;</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">h4</span>&gt;</span>&#x5546;&#x54C1;&#x540D;&#x79F0;&#x624B;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">h4</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">div</span>&gt;</span>4<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">img</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;images/goods/goods002.jpg&quot;</span> <span class="hljs-attribute">alt</span>=<span class="hljs-value">&quot;&#x5546;&#x54C1;&#x56FE;&#x7247;&quot;</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">h4</span>&gt;</span>&#x5546;&#x54C1;&#x540D;&#x79F0;&#x624B;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">h4</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">div</span>&gt;</span>5<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">img</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;images/goods/goods003.jpg&quot;</span> <span class="hljs-attribute">alt</span>=<span class="hljs-value">&quot;&#x5546;&#x54C1;&#x56FE;&#x7247;&quot;</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">h4</span>&gt;</span>&#x5546;&#x54C1;&#x540D;&#x79F0;&#x624B;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">h4</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">div</span>&gt;</span>6<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">img</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;images/goods/goods003.jpg&quot;</span> <span class="hljs-attribute">alt</span>=<span class="hljs-value">&quot;&#x5546;&#x54C1;&#x56FE;&#x7247;&quot;</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">h4</span>&gt;</span>&#x5546;&#x54C1;&#x540D;&#x79F0;&#x624B;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">h4</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">div</span>&gt;</span>6<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">ul</span>&gt;</span>            
        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;navbar_con&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;navbar&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;sub_menu_con fl&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">h1</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;fl&quot;</span>&gt;</span>&#x5546;&#x54C1;&#x5206;&#x7C7B;<span class="hljs-tag">&lt;/<span class="hljs-title">h1</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">ul</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;sub_menu&quot;</span>&gt;</span>            
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x624B;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x8FD0;&#x8425;&#x5546;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x6570;&#x7801;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x624B;&#x673A;&#x901A;&#x8BAF; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x624B;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5BF9;&#x8BB2;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4EE5;&#x65E7;&#x6362;&#x65B0;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x624B;&#x673A;&#x7EF4;&#x4FEE;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>                        
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x8FD0;&#x8425;&#x5546; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5408;&#x7EA6;&#x673A;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x9009;&#x53F7;&#x7801;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x56FA;&#x8BDD;&#x5BBD;&#x5E26;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x529E;&#x5957;&#x9910;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5145;&#x8BDD;&#x8D39;/&#x6D41;&#x91CF;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4E2D;&#x56FD;&#x7535;&#x4FE1;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4E2D;&#x56FD;&#x79FB;&#x52A8;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4E2D;&#x56FD;&#x8054;&#x901A;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4EAC;&#x4E1C;&#x901A;&#x4FE1;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>170&#x9009;&#x53F7;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>                                                
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7535;&#x8111;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x529E;&#x516C;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x7535;&#x8111; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x66F2;&#x9762;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x8D85;&#x8584;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>HDR&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>OLED&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>4K&#x8D85;&#x6E05;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4EBA;&#x5DE5;&#x667A;&#x80FD;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>55&#x82F1;&#x5BF8;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>65&#x82F1;&#x5BF8;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                                    
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5BB6;&#x5C45;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5BB6;&#x5177;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5BB6;&#x88C5;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x53A8;&#x5177;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x5BB6;&#x5177; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x66F2;&#x9762;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x8D85;&#x8584;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>HDR&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>OLED&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>4K&#x8D85;&#x6E05;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x4EBA;&#x5DE5;&#x667A;&#x80FD;&#x7535;&#x89C6;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>55&#x82F1;&#x5BF8;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>65&#x82F1;&#x5BF8;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                                    
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7537;&#x88C5;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5973;&#x88C5;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7AE5;&#x88C5;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5185;&#x8863;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x7537;&#x88C5; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7537;&#x88C5;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5973;&#x978B;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7BB1;&#x5305;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x949F;&#x8868;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x73E0;&#x5B9D;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x5973;&#x978B; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5973;&#x978B;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7537;&#x978B;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x8FD0;&#x52A8;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x6237;&#x5916;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x7537;&#x978B; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7537;&#x978B;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x623F;&#x4EA7;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x6C7D;&#x8F66;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x6C7D;&#x8F66;&#x7528;&#x54C1;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x6C7D;&#x8F66;&#x7528;&#x54C1; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x6C7D;&#x8F66;&#x7528;&#x54C1;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x6BCD;&#x5A74;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x73A9;&#x5177;&#x4E50;&#x5668;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x73A9;&#x5177;&#x4E50;&#x5668; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x73A9;&#x5177;&#x4E50;&#x5668;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x98DF;&#x54C1;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x9152;&#x7C7B;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x751F;&#x9C9C;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7279;&#x4EA7;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x98DF;&#x54C1; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x98DF;&#x54C1;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x56FE;&#x4E66;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x97F3;&#x50CF;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x7535;&#x5B50;&#x4E66;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x56FE;&#x4E66; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x56FE;&#x4E66;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level1&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x673A;&#x7968;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x9152;&#x5E97;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x65C5;&#x6E38;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x751F;&#x6D3B;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;level2&quot;</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;list_group&quot;</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_name fl&quot;</span>&gt;</span>&#x673A;&#x7968; &amp;gt;<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;group_detail fl&quot;</span>&gt;</span>
                                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x673A;&#x7968;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>                            
                                <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">ul</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>        


            <span class="hljs-tag">&lt;<span class="hljs-title">ul</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;navlist fl&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;&quot;</span>&gt;</span>&#x9996;&#x9875;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;interval&quot;</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;&quot;</span>&gt;</span>&#x771F;&#x5212;&#x7B97;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;interval&quot;</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;&quot;</span>&gt;</span>&#x62BD;&#x5956;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">ul</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>


    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;main_wrap clearfix&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot; clearfix&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">ul</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;goods_type_list clearfix&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">li</span> <span class="hljs-attribute">v-for</span>=<span class="hljs-value">&quot;sku in skus&quot;</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">:href</span>=<span class="hljs-value">sku.url</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">img</span> <span class="hljs-attribute">:src</span>=<span class="hljs-value">&quot;sku.default_image_url&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">h4</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">:href</span>=<span class="hljs-value">sku.url</span>&gt;</span>[[sku.name]]<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">h4</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;operate&quot;</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">span</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;prize&quot;</span>&gt;</span>&#xFFE5;[[sku.price]]<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>[[sku.comments]]&#x8BC4;&#x4EF7;<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">li</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">ul</span>&gt;</span>
            <span class="hljs-comment">&lt;!--&lt;div v-if=&quot;skus.length==0&quot;&gt;&lt;p&gt;&#x6682;&#x65F6;&#x6CA1;&#x6709;&#x5546;&#x54C1;&#x3002;&lt;/p&gt;&lt;/div&gt;--&gt;</span>

            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;pagenation&quot;</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">v-show</span>=<span class="hljs-value">&quot;previous&quot;</span> @<span class="hljs-attribute">click</span>=<span class="hljs-value">&quot;on_page(previous)&quot;</span>&gt;</span>&#x4E0A;&#x4E00;&#x9875;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">v-for</span>=<span class="hljs-value">&quot;num in page_nums&quot;</span> @<span class="hljs-attribute">click</span>=<span class="hljs-value">&quot;on_page(num)&quot;</span> <span class="hljs-attribute">:class</span>=<span class="hljs-value">&quot;num==page?&apos;active&apos;:&apos;&apos;&quot;</span>&gt;</span>[[num]]<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">v-show</span>=<span class="hljs-value">&quot;next&quot;</span> @<span class="hljs-attribute">click</span>=<span class="hljs-value">&quot;on_page(next)&quot;</span>&gt;</span>&#x4E0B;&#x4E00;&#x9875;&gt;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;footer&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;foot_link&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x5173;&#x4E8E;&#x6211;&#x4EEC;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x8054;&#x7CFB;&#x6211;&#x4EEC;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x62DB;&#x8058;&#x4EBA;&#x624D;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">span</span>&gt;</span>|<span class="hljs-tag">&lt;/<span class="hljs-title">span</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;#&quot;</span>&gt;</span>&#x53CB;&#x60C5;&#x94FE;&#x63A5;<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>        
        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>CopyRight &#xA9; 2016 &#x5317;&#x4EAC;&#x7F8E;&#x591A;&#x5546;&#x4E1A;&#x80A1;&#x4EFD;&#x6709;&#x9650;&#x516C;&#x53F8; All Rights Reserved<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>&#x7535;&#x8BDD;&#xFF1A;010-****888    &#x4EAC;ICP&#x5907;*******8&#x53F7;<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text/javascript&quot;</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;js/search.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-title">script</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">html</span>&gt;</span>
</code></pre>
<p>&#x5728;search.js&#x4E2D;&#x5C06;q&#x7684;&#x5173;&#x952E;&#x8BCD;&#x53D1;&#x9001;&#x7ED9;&#x540E;&#x7AEF;/skus/search/&#x63A5;&#x53E3;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> vm = <span class="hljs-keyword">new</span> Vue({
    el: <span class="hljs-string">&apos;#app&apos;</span>,
    delimiters: [<span class="hljs-string">&apos;[[&apos;</span>, <span class="hljs-string">&apos;]]&apos;</span>], <span class="hljs-comment">// &#x4FEE;&#x6539;vue&#x6A21;&#x677F;&#x7B26;&#x53F7;&#xFF0C;&#x9632;&#x6B62;&#x4E0E;django&#x51B2;&#x7A81;</span>
    data: {
        host: host,
        username: sessionStorage.username || localStorage.username,
        user_id: sessionStorage.user_id || localStorage.user_id,
        token: sessionStorage.token || localStorage.token,
        page: <span class="hljs-number">1</span>, <span class="hljs-comment">// &#x5F53;&#x524D;&#x9875;&#x6570;</span>
        page_size: <span class="hljs-number">6</span>, <span class="hljs-comment">// &#x6BCF;&#x9875;&#x6570;&#x91CF;</span>
        count: <span class="hljs-number">0</span>,  <span class="hljs-comment">// &#x603B;&#x6570;&#x91CF;</span>
        skus: [], <span class="hljs-comment">// &#x6570;&#x636E;</span>
        query: <span class="hljs-string">&apos;&apos;</span>,  <span class="hljs-comment">// &#x67E5;&#x8BE2;&#x5173;&#x952E;&#x5B57;</span>
        cart_total_count: <span class="hljs-number">0</span>, <span class="hljs-comment">// &#x8D2D;&#x7269;&#x8F66;&#x603B;&#x6570;&#x91CF;</span>
        cart: [], <span class="hljs-comment">// &#x8D2D;&#x7269;&#x8F66;&#x6570;&#x636E;</span>
    },
    computed: {
        total_page: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{  <span class="hljs-comment">// &#x603B;&#x9875;&#x6570;</span>
            <span class="hljs-keyword">return</span> <span class="hljs-built_in">Math</span>.ceil(<span class="hljs-keyword">this</span>.count/<span class="hljs-keyword">this</span>.page_size);
        },
        next: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{  <span class="hljs-comment">// &#x4E0B;&#x4E00;&#x9875;</span>
            <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.page &gt;= <span class="hljs-keyword">this</span>.total_page) {
                <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
            } <span class="hljs-keyword">else</span> {
                <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.page + <span class="hljs-number">1</span>;
            }
        },
        previous: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{  <span class="hljs-comment">// &#x4E0A;&#x4E00;&#x9875;</span>
            <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.page &lt;= <span class="hljs-number">0</span> ) {
                <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
            } <span class="hljs-keyword">else</span> {
                <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.page - <span class="hljs-number">1</span>;
            }
        },
        page_nums: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{  <span class="hljs-comment">// &#x9875;&#x7801;</span>
            <span class="hljs-comment">// &#x5206;&#x9875;&#x9875;&#x6570;&#x663E;&#x793A;&#x8BA1;&#x7B97;</span>
            <span class="hljs-comment">// 1.&#x5982;&#x679C;&#x603B;&#x9875;&#x6570;&lt;=5</span>
            <span class="hljs-comment">// 2.&#x5982;&#x679C;&#x5F53;&#x524D;&#x9875;&#x662F;&#x524D;3&#x9875;</span>
            <span class="hljs-comment">// 3.&#x5982;&#x679C;&#x5F53;&#x524D;&#x9875;&#x662F;&#x540E;3&#x9875;,</span>
            <span class="hljs-comment">// 4.&#x65E2;&#x4E0D;&#x662F;&#x524D;3&#x9875;&#xFF0C;&#x4E5F;&#x4E0D;&#x662F;&#x540E;3&#x9875;</span>
            <span class="hljs-keyword">var</span> nums = [];
            <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.total_page &lt;= <span class="hljs-number">5</span>) {
                <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i=<span class="hljs-number">1</span>; i&lt;=<span class="hljs-keyword">this</span>.total_page; i++){
                    nums.push(i);
                }
            } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.page &lt;= <span class="hljs-number">3</span>) {
                nums = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
            } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.total_page - <span class="hljs-keyword">this</span>.page &lt;= <span class="hljs-number">2</span>) {
                <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i=<span class="hljs-keyword">this</span>.total_page; i&gt;<span class="hljs-keyword">this</span>.total_page-<span class="hljs-number">5</span>; i--) {
                    nums.push(i);
                }
            } <span class="hljs-keyword">else</span> {
                <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i=<span class="hljs-keyword">this</span>.page-<span class="hljs-number">2</span>; i&lt;<span class="hljs-keyword">this</span>.page+<span class="hljs-number">3</span>; i++){
                    nums.push(i);
                }
            }
            <span class="hljs-keyword">return</span> nums;
        }
    },
    mounted: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{
        <span class="hljs-keyword">this</span>.query = <span class="hljs-keyword">this</span>.get_query_string(<span class="hljs-string">&apos;q&apos;</span>);
        <span class="hljs-keyword">this</span>.get_search_result();
        <span class="hljs-keyword">this</span>.get_cart();
    },
    methods: {
        logout(){
            sessionStorage.clear();
            localStorage.clear();
            location.href = <span class="hljs-string">&apos;/login.html&apos;</span>;
        },
        <span class="hljs-comment">// &#x83B7;&#x53D6;url&#x8DEF;&#x5F84;&#x53C2;&#x6570;</span>
        get_query_string: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">name</span>)</span>{
            <span class="hljs-keyword">var</span> reg = <span class="hljs-keyword">new</span> <span class="hljs-built_in">RegExp</span>(<span class="hljs-string">&apos;(^|&amp;)&apos;</span> + name + <span class="hljs-string">&apos;=([^&amp;]*)(&amp;|$)&apos;</span>, <span class="hljs-string">&apos;i&apos;</span>);
            <span class="hljs-keyword">var</span> r = <span class="hljs-built_in">window</span>.location.search.substr(<span class="hljs-number">1</span>).match(reg);
            <span class="hljs-keyword">if</span> (r != <span class="hljs-literal">null</span>) {
                <span class="hljs-keyword">return</span> <span class="hljs-built_in">decodeURI</span>(r[<span class="hljs-number">2</span>]);
            }
            <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;
        },
        <span class="hljs-comment">// &#x8BF7;&#x6C42;&#x67E5;&#x8BE2;&#x7ED3;&#x679C;</span>
        get_search_result: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{
            axios.get(<span class="hljs-keyword">this</span>.host+<span class="hljs-string">&apos;/skus/search/&apos;</span>, {
                    params: {
                        text: <span class="hljs-keyword">this</span>.query,
                        page: <span class="hljs-keyword">this</span>.page,
                        page_size: <span class="hljs-keyword">this</span>.page_size,
                    },
                    responseType: <span class="hljs-string">&apos;json&apos;</span>
                })
                .then(response =&gt; {
                    <span class="hljs-keyword">this</span>.skus = [];
                    <span class="hljs-keyword">this</span>.count = response.data.count;
                    <span class="hljs-keyword">var</span> results = response.data.results;
                    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i=<span class="hljs-number">0</span>; i&lt; results.length; i++){
                        <span class="hljs-keyword">var</span> sku = results[i].object;
                        sku.url = <span class="hljs-string">&apos;/goods/&apos;</span> + sku.id + <span class="hljs-string">&quot;.html&quot;</span>;
                        <span class="hljs-keyword">this</span>.skus.push(sku);
                    }
                })
                .catch(error =&gt; {
                    <span class="hljs-built_in">console</span>.log(error.response.data);
                })
        },
        <span class="hljs-comment">// &#x70B9;&#x51FB;&#x9875;&#x6570;</span>
        on_page: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">num</span>)</span>{
            <span class="hljs-keyword">if</span> (num != <span class="hljs-keyword">this</span>.page){
                <span class="hljs-keyword">this</span>.page = num;
                <span class="hljs-keyword">this</span>.get_search_result();
            }
        },
        <span class="hljs-comment">// &#x83B7;&#x53D6;&#x8D2D;&#x7269;&#x8F66;&#x6570;&#x636E;</span>
        get_cart: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{

        }
    }
});
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../C03-Goods/GoodsList.html" class="navigation navigation-prev " aria-label="Previous page: 商品列表页"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../C04-Cart/index.html" class="navigation navigation-next " aria-label="Next page: 购物车部分"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
